﻿<%@ Control Language="VB" AutoEventWireup="false" CodeFile="SearchWorkHeader.ascx.vb"
    Inherits="WebForm_SelfManageWorkHeader_SearchWorkHeader" %>
<%@ Register Namespace="My" TagPrefix="cc1" %>
<%@ Register Namespace="Tooltip" Assembly="Tooltip" TagPrefix="tt" %>  
<script type="text/javascript"> 
function Check(parentChk,ChildId) 
{     
    var oElements = document.getElementsByTagName("INPUT");     
    var bIsChecked = parentChk.checked;  
    for(i=0; i<oElements.length;i++)     
    {         
        if( IsCheckBox(oElements[i]) && IsMatch(oElements[i].id, ChildId))
        {             
            oElements[i].checked = bIsChecked;         
        }             
    }    
}  

function IsMatch(id, ChildId) 
{     
    var sPattern = ChildId;     
    var oRegExp = new RegExp(sPattern);     
    if(oRegExp.exec(id))          
        return true;     
    else          
        return false; 
}  
function IsCheckBox(chk) 
{     
    if(chk.type == 'checkbox') 
        return true;     
    else 
        return false; 
} 
</script>  
<table>
    <tr>
        <td align="right">
            <asp:Label ID="lblFindDirtyHeaderID" runat="server" meta:resourcekey="lblFindDirtyHeaderID"></asp:Label>
        </td>
        <td align="left">
            <asp:TextBox ID="txtFindDirtyHeaderID" runat="server"></asp:TextBox>
        </td>
        <td align="right">
        </td>
        <td align="left">
        </td>
    </tr>
    <tr>
        <td align="right">
            <asp:Label ID="lblCreateBy" runat="server" meta:resourcekey="lblCreateBy"></asp:Label>
        </td>
        <td align="left">
            <asp:TextBox ID="txtCreateBy" runat="server"></asp:TextBox>
        </td>
        <td align="right">
            <asp:Label ID="lblCreateTel" runat="server" meta:resourcekey="lblCreateTel"></asp:Label>
        </td>
        <td align="left">
            <asp:TextBox ID="txtCreateTel" runat="server"></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td align="right">
            <asp:Label ID="lblCreateEmail" runat="server" meta:resourcekey="lblCreateEmail"></asp:Label>
        </td>
        <td align="left">
            <asp:TextBox ID="txtCreateEmail" runat="server"></asp:TextBox>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtCreateEmail"
                        Display="None" meta:resourcekey="ErrorEmail" SetFocusOnError="True" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                        ValidationGroup="vQuery"></asp:RegularExpressionValidator>
        </td>
        <td align="right">
            <asp:Label ID="lblRegionType" runat="server" meta:resourcekey="lblRegionType"></asp:Label>
        </td>
        <td align="left">
            <asp:DropDownList ID="ddlRegionType" runat="server" AutoPostBack="false">
            </asp:DropDownList>
        </td>
    </tr>
    <tr>
        <td align="right">
            <asp:Label ID="lblReportDate" runat="server" meta:resourcekey="lblReportDate"></asp:Label>
        </td>
        <td align="left">
            <asp:TextBox ID="txtReportDateStart" Width="70px" runat="server"></asp:TextBox>
            <ajaxToolkit:CalendarExtender ID="ceReportDateStart" runat="server" Format="yyyy/MM/dd" TargetControlID="txtReportDateStart">
            </ajaxToolkit:CalendarExtender>
            <asp:CompareValidator meta:resourcekey="cvReportDateStart" ID="cvReportDateStart" runat="server" ControlToValidate="txtReportDateStart" Display="None"
                Operator="DataTypeCheck" SetFocusOnError="True" Type="Date" ValidationGroup="vQuery"></asp:CompareValidator>
            ~
            <asp:TextBox ID="txtReportDateEnd" Width="70px" runat="server"></asp:TextBox>
            <ajaxToolkit:CalendarExtender ID="ceReportDateEnd" runat="server" Format="yyyy/MM/dd" TargetControlID="txtReportDateEnd">
            </ajaxToolkit:CalendarExtender>
            <asp:CompareValidator meta:resourcekey="cvReportDateEnd" ID="cvReportDateEnd" runat="server" ControlToValidate="txtReportDateEnd" Display="None"
                Operator="DataTypeCheck" SetFocusOnError="True" Type="Date" ValidationGroup="vQuery"></asp:CompareValidator>
        </td>
        <td align="right">
            <asp:Label Visible="false" ID="lblHandleDate" runat="server" meta:resourcekey="lblHandleDate"></asp:Label>
        </td>
        <td align="left">
            <asp:TextBox Visible="false" ID="txtHandleDateStart" Width="70px" runat="server"></asp:TextBox>
            <ajaxToolkit:CalendarExtender ID="ceHandleDateStart" runat="server" Format="yyyy/MM/dd" TargetControlID="txtHandleDateStart">
            </ajaxToolkit:CalendarExtender>
            <asp:CompareValidator meta:resourcekey="cvHandleDateStart" ID="cvHandleDateStart" runat="server" ControlToValidate="txtHandleDateStart" Display="None"
                Operator="DataTypeCheck" SetFocusOnError="True" Type="Date" ValidationGroup="vQuery"></asp:CompareValidator>
            
            <asp:TextBox Visible="false" ID="txtHandleDateEnd" Width="70px" runat="server"></asp:TextBox>
            <ajaxToolkit:CalendarExtender ID="ceHandleDateEnd" runat="server" Format="yyyy/MM/dd" TargetControlID="txtHandleDateEnd">
            </ajaxToolkit:CalendarExtender>
            <asp:CompareValidator meta:resourcekey="cvHandleDateEnd" ID="cvHandleDateEnd" runat="server" ControlToValidate="txtHandleDateEnd" Display="None"
                Operator="DataTypeCheck" SetFocusOnError="True" Type="Date" ValidationGroup="vQuery"></asp:CompareValidator>
        </td>
    </tr>
    <tr>
        <td align="right">
            <asp:Label ID="lblTownID" runat="server" meta:resourcekey="lblTownID"></asp:Label>
        </td>
        <td align="left">
            <asp:DropDownList ID="ddlTownID" runat="server">
            </asp:DropDownList>
        </td>
        <td align="right"> 
            <asp:Label ID="lblStatus" runat="server" meta:resourcekey="lblStatus"></asp:Label>
        </td>
        <td align="left"> 
            <asp:DropDownList ID="ddlStatus" runat="server" AutoPostBack="false">
            </asp:DropDownList>
        </td>
    </tr>
    <tr>
        <td align="right">
            <asp:Label ID="lblActive" runat="server" meta:resourcekey="lblActive"></asp:Label>
        </td>
        <td align="left">
            <asp:DropDownList ID="ddlActive" runat="server">
            </asp:DropDownList>
        </td>
        <td align="right"> 
 
        </td>
        <td align="left"> 
 
        </td>
    </tr>
    <tr>
        <td align="center" colspan="4">
            <asp:ImageButton  ID="btnQuery" ImageUrl="~/images/image/but_10.jpg" ValidationGroup="vQuery" runat="server" />
            <asp:ImageButton  ID="btnExport" Visible="false" ImageUrl="~/images/image/but_11.jpg" ValidationGroup="vQuery" runat="server" />
            <asp:ImageButton  ID="btnSelectExport" Visible="false" ImageUrl="~/images/image/but_12.jpg" runat="server" />
            <asp:HyperLink ID="hlinkDescription" visible="false" SkinID="Description" runat="server"></asp:HyperLink>
            <asp:ValidationSummary ID="ValidationSummary2" runat="server" ShowMessageBox="True"
            ShowSummary="False" ValidationGroup="vQuery" />
			  <tt:TooltipExtender 
					id="TooltipExtender1" 
					TargetControlID="btnExport" 
					runat="server"
					Delay="1"
					Direction="Top"
					TooltipWidth="250"
					>
					<TooltipTemplate>
						<asp:Label ID="lblWorkHeaderDescription" SkinID="label" CssClass="Description" runat="server" Text="可匯出全部髒亂點通報資料"></asp:Label> 
					</TooltipTemplate>
				  </tt:TooltipExtender>
			  <tt:TooltipExtender 
					id="TooltipExtender2" 
					TargetControlID="btnSelectExport" 
					runat="server"
					Delay="1"
					Direction="Top"
					TooltipWidth="300"
					>
					<TooltipTemplate>
						<asp:Label ID="Label1" SkinID="label" CssClass="Description" runat="server" Text="可匯出有勾選的髒亂點通報資料"></asp:Label> 
					</TooltipTemplate>
				  </tt:TooltipExtender>            <asp:ValidationSummary ID="ValidationSummary1" runat="server" ShowMessageBox="True"
            ShowSummary="False" ValidationGroup="vQuery" />
        </td>
    </tr>
</table>
<br />
<My:MyGridView ID="gv" EmptyDataRowStyle-HorizontalAlign="Center" AllowSorting="true" HeaderStyle-HorizontalAlign="Center" runat="server" SkinID="pager" AllowHoverSelect="False" DataKeyNames="FindDirtyHeaderID"
    AllowHoverEffect="True" MySortDirection="Ascending" meta:resourcekey="gv" TotalRowCount="0">
    <Columns>
        <asp:TemplateField>
            <headertemplate>
<asp:CheckBox id="chkSelectAll" onclick="Check(this,'chkSelect');"  runat="server" __designer:wfdid="w8" meta:resourcekey="chkSelectAll"></asp:CheckBox>
</headertemplate>
            <itemtemplate>
<asp:CheckBox id="chkSelect" runat="server" __designer:wfdid="w1"></asp:CheckBox> 
</itemtemplate>
            <headerstyle horizontalalign="Center" width="50px" />
            <itemstyle horizontalalign="Center" />
        </asp:TemplateField>
        <asp:BoundField DataField="RegionName" meta:resourcekey="bfRegionName" SortExpression="RegionName" />
        <asp:BoundField DataField="CasePassword" meta:resourcekey="bfFindDirtyHeaderID" SortExpression="a.CasePassword">   
        <itemstyle horizontalalign="Center" />
        </asp:BoundField>
<%--        <asp:BoundField DataField="RegionType" meta:resourcekey="bfRegionType" SortExpression="a.RegionType">
            <itemstyle horizontalalign="Center" />
        </asp:BoundField>
--%>    
        <asp:BoundField DataField="Address" meta:resourcekey="bfAddress" SortExpression="Address" />
        <asp:TemplateField meta:resourcekey="bfTopic" SortExpression="Topic">        
            <ItemTemplate>
                <asp:Label ID="lblTopic" runat="server" Text='<%# Eval("Topic") %>'></asp:Label>
            </ItemTemplate>
            <headerstyle horizontalalign="Center" width="90px" />
            <itemstyle horizontalalign="left" width="90px" />
        </asp:TemplateField>  
        <asp:BoundField DataField="ReportDate" dataformatstring="{0:yyyy.MM.dd HH:mm}" SortExpression="ReportDate" meta:resourcekey="bfReportDate" >
            <itemstyle horizontalalign="Center" />
        </asp:BoundField>
<%--        <asp:BoundField DataField="HandleDays" SortExpression="HandleDays" meta:resourcekey="bfHandleDays" >
            <headerstyle horizontalalign="Center" width="60px" />  
            <itemstyle horizontalalign="Center" />
        </asp:BoundField>--%>
        <asp:BoundField DataField="StatusText" meta:resourcekey="bfStatusText" SortExpression="StatusText" >
            <headerstyle horizontalalign="Center" width="100px" />
            <itemstyle horizontalalign="left" width="100px" />
        </asp:BoundField>
        <asp:TemplateField>        
            <ItemTemplate>
<asp:LinkButton id="lknEdit" meta:resourcekey="lknEdit" runat="server" CommandName="Update" __designer:wfdid="w1"></asp:LinkButton> 
</ItemTemplate>
            <itemstyle horizontalalign="Center" />
        </asp:TemplateField>        
        <asp:TemplateField>        
            <ItemTemplate>
<asp:LinkButton id="lknDelete" meta:resourcekey="lknDelete" runat="server" __designer:wfdid="w2" OnClick="lknDelete_Click"></asp:LinkButton> <ajaxToolkit:ConfirmButtonExtender id="cbDelete" meta:resourcekey="cbDelete" runat="server" TargetControlID="lknDelete" __designer:wfdid="w3"></ajaxToolkit:ConfirmButtonExtender> 
</ItemTemplate>
            <itemstyle horizontalalign="Center" />
        </asp:TemplateField>
    </Columns>
    <EmptyDataRowStyle HorizontalAlign="Center" />
</My:MyGridView>
